<template>
	<view>
		<view class="address">
			<text class="address-text1">当前位置：</text>
			<text class="address-text2 uni-ellipsis">{{address}}</text>
		</view>
		<view class="address">
			<view style="width: 50%;">
			<text class="address-text1">距离可打卡：</text>
			<text class="uni-ellipsis">{{distance.distance}}米</text>
			</view>	
			<view style="width: 50%;">
				<text class="address-text1">范围：</text>
				<text class="uni-ellipsis">{{distance.range}}米</text>
			</view>			
		</view>
		<view class="bottom">
			<button type="warn" size="mini" @tap="updateAddress">更新当前位置</button>
		</view>
	</view>
</template>

<script>
	export default{
		name:"clock-addrress",
		props:{
			address:String,
			distance:Object
		},
		data(){
			return{
				
			}
		},
		methods:{
			updateAddress(){
				this.$emit('change')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.address{
		display: flex;
		height: 60upx;
		align-items:center;
		padding: 0 30upx;
		flex-direction: 
		text{
			font-size:$uni-font-size-lg; 
		}
		&-text1{
			width: auto;
			font-weight:800;
			color:$uni-text-color;
			justify-content: space-between;
		}
		&-text2{
			width: 78%;
			color:$uni-text-color-placeholder;
			font-weight:bold;
		}
	}
	.bottom{
		display: flex;
		align-items: center;
		justify-content:center;
		padding: 10upx 0;
	}
</style>
